﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AddTrainingCourse.ascx.vb"
    Inherits="WebForm_ManageTrainingCourse_AddTrainingCourse" %>
<asp:FormView ID="FV" runat="server" DataSourceID="ObjectDataSource1" DataKeyNames="Id">
    <ItemTemplate>
        <table>
            <tr>
                <td align="right">
                    &nbsp;
                </td>
                <td colspan="3">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td  align="right">
                    <asp:Label ID="lblCourseName" runat="server" Text="<%$ Resources:CourseName %>"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtCourseName" runat="server" MaxLength="50" Text='<%# Bind("CourseName") %>'
                        Width="95%"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="chk_txtCourseName" runat="server" ControlToValidate="txtCourseName"
                        Display="None" ErrorMessage="<%$ Resources:chk_txtCourseName %>" ValidationGroup="AddTrainingCourseSave"></asp:RequiredFieldValidator>
                </td>
                <td  align="right">
                    <asp:Label ID="lblCourseType" runat="server" Text="<%$ Resources:CourseType %>"></asp:Label>
                </td>
                <td>
                    <asp:RadioButtonList ID="rblCourseType" runat="server" DataSourceID="SqlDataSource_CourseType"
                        DataTextField="Text" DataValueField="Value" SelectedValue='<%# Bind("CourseType") %>'
                        RepeatDirection="Horizontal">
                    </asp:RadioButtonList>
                    <asp:RequiredFieldValidator ID="chk_rblCourseType" runat="server" ControlToValidate="rblCourseType"
                        Display="None" ErrorMessage="<%$ Resources:chk_rblCourseType %>" ValidationGroup="AddTrainingCourseSave"></asp:RequiredFieldValidator>
                    <asp:SqlDataSource ID="SqlDataSource_CourseType" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
                        SelectCommand="SELECT [Value], [Text] 
FROM [CodeMapping] 
WHERE (([TableName] = @TableName) AND ([ColumnName] = @ColumnName)) AND [Value] in ('B','S')">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="TrainingCourseGroup" Name="TableName" Type="String" />
                            <asp:Parameter DefaultValue="GroupType" Name="ColumnName" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
<%--                <td align="right" width="20%">
                    <asp:Label ID="lblClassPlace" runat="server" Text="<%$ Resources:ClassPlace %>"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtClassPlace" runat="server" MaxLength="25" Text='<%# Bind("ClassPlace") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="chk_txtClassPlace" runat="server" ControlToValidate="txtClassPlace"
                        Display="None" ErrorMessage="<%$ Resources:chk_txtClassPlace %>" ValidationGroup="AddTrainingCourseSave"></asp:RequiredFieldValidator>                        
                </td>
--%>                <td align="right" >
                    <asp:Label ID="lblTeacherEmail" runat="server" Text="<%$ Resources:TeacherEmail %>"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtTeacherEmail" runat="server" MaxLength="25" Text='<%# Bind("TeacherEmail") %>'></asp:TextBox>
                </td>                
                <td align="right" >
                    <asp:Label ID="lblTeacherName" runat="server" Text="<%$ Resources:TeacherName %>"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtTeacherName" runat="server" MaxLength="25" Text='<%# Bind("TeacherName") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="chk_txtTeacherName" runat="server" ControlToValidate="txtTeacherName"
                        Display="None" ErrorMessage="<%$ Resources:chk_txtTeacherName %>" ValidationGroup="AddTrainingCourseSave"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="right" >
                    <asp:Label ID="lblTeacherTEL" runat="server" Text="<%$ Resources:TeacherTEL %>"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtTeacherTEL" runat="server" MaxLength="25" 
                        Text='<%# Bind("TeacherTEL") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="chk_txtTeacherTEL" runat="server" 
                        ControlToValidate="txtTeacherTEL" Display="None" 
                        ErrorMessage="<%$ Resources:chk_txtTeacherTEL %>" 
                        ValidationGroup="AddTrainingCourseSave"></asp:RequiredFieldValidator>
                </td>
                <td align="right" >
                    <asp:Label ID="lblOrg" runat="server" Text="<%$ Resources:Org %>"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtOrg" runat="server" MaxLength="25" 
                        Text='<%# Bind("Org") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="chk_txtOrg" runat="server" 
                        ControlToValidate="txtOrg" Display="None" 
                        ErrorMessage="<%$ Resources:chk_txtOrg %>" 
                        ValidationGroup="AddTrainingCourseSave"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblHour" runat="server" Text="<%$ Resources:Hour %>"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtHour" runat="server" MaxLength="4" 
                        Text='<%# Bind("Hour") %>' Width="44px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="chk_txtHour" runat="server" 
                        ControlToValidate="txtHour" Display="None" 
                        ErrorMessage="<%$ Resources:chk_txtHour %>" 
                        ValidationGroup="AddTrainingCourseSave"></asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="chk_txtHour2" runat="server" 
                        ControlToValidate="txtHour" Display="None" 
                        ErrorMessage="<%$ Resources:chk_txtHour2 %>" MaximumValue="9999" 
                        MinimumValue="1" Type="Integer" ValidationGroup="AddTrainingCourseSave"></asp:RangeValidator>
                </td>
                <td align="right">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblClassDetail" runat="server" Text="<%$ Resources:ClassDetail %>"></asp:Label>
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtClassDetail" runat="server" Text='<%# Bind("ClassDetail") %>'
                        Height="200px" MaxLength="2000" TextMode="MultiLine" Width="100%"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="chk_txtClassDetail" runat="server" ControlToValidate="txtClassDetail"
                        Display="None" ErrorMessage="<%$ Resources:chk_txtClassDetail %>" ValidationGroup="AddTrainingCourseSave"></asp:RequiredFieldValidator>
                </td>
                <td valign="bottom">
                    <asp:ValidationSummary ID="sum_AddTrainingCourseSave" runat="server" DisplayMode="List"
                        ShowMessageBox="True" ShowSummary="False" ValidationGroup="AddTrainingCourseSave" />
                    <ajaxToolkit:ConfirmButtonExtender ID="cbSave" runat="server" ConfirmText="<%$ Resources:SaveConfirm %>"
                        Enabled="True" meta:resourcekey="cbSave" TargetControlID="btnSave">
                    </ajaxToolkit:ConfirmButtonExtender>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:FormView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" InsertMethod="BLL_Insert"
    OldValuesParameterFormatString="original_{0}" SelectMethod="BLL_Select" TypeName="BLL_AddTrainingCourse"
    UpdateMethod="BLL_Update">
    <UpdateParameters>
        <asp:Parameter Name="CourseName" Type="String" />
        <asp:Parameter Name="CourseType" Type="String" />
        <asp:Parameter Name="TeacherEmail" Type="String" />
        <asp:Parameter Name="TeacherName" Type="String" />
        <asp:Parameter Name="TeacherTEL" Type="String" />
        <asp:Parameter Name="Org" Type="String" />
        <asp:Parameter Name="Hour" Type="Int32" />
        <asp:Parameter Name="ClassDetail" Type="String" />
        <asp:Parameter Name="original_Id" Type="Int32" />
    </UpdateParameters>
    <SelectParameters>
        <asp:Parameter Name="Id" Type="Int32" />
    </SelectParameters>
    <InsertParameters>
        <asp:Parameter Name="CourseName" Type="String" />
        <asp:Parameter Name="CourseType" Type="String" />
        <asp:Parameter Name="TeacherEmail" Type="String" />
        <asp:Parameter Name="TeacherName" Type="String" />
        <asp:Parameter Name="TeacherTEL" Type="String" />
        <asp:Parameter Name="Org" Type="String" />
        <asp:Parameter Name="Hour" Type="Int32" />
        <asp:Parameter Name="ClassDetail" Type="String" />
    </InsertParameters>
</asp:ObjectDataSource>
<div align="center">
    <asp:Button ID="btnSave" runat="server" CommandName="btnSave" meta:resourcekey="btnSave"
        Text="<%$ Resources:Save %>" ValidationGroup="AddTrainingCourseSave" />
</div>
